home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Applications / Macintosh Tracker 1.20 / source / Server⁄Tracker 4.0 / prefs.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-01  |  1.3 KB  |  75 lines  |  [TEXT/KAHL]

  1. /* prefs.c */
  2. /* $Id: prefs.c,v 4.0 1994/01/11 17:53:41 espie Exp espie $
  3.  * $Log: prefs.c,v $
  4.  * Revision 4.0  1994/01/11  17:53:41  espie
  5.  * *** empty log message ***
  6.  *
  7.  * Revision 1.3  1994/01/09  17:36:22  Espie
  8.  * Generalized open.c.
  9.  *
  10.  * Revision 1.2  1994/01/07  15:06:26  Espie
  11.  * VERY stupid bug.
  12.  *
  13.  * Revision 1.1  1994/01/06  22:32:42  Espie
  14.  * Initial revision
  15.  *
  16.  */
  17.  
  18. #include <stdio.h>
  19. #include "defs.h"
  20. #include "extern.h"
  21. #include "prefs.h"
  22. #include "tags.h"
  23.  
  24. ID("$Id: prefs.c,v 4.0 1994/01/11 17:53:41 espie Exp espie $")
  25. LOCAL void init_prefs P((void));
  26.  
  27. LOCAL void (*INIT)P((void)) = init_prefs;
  28.  
  29. LOCAL struct tag preferences[NUMBER_PREFS];
  30.  
  31. LOCAL void init_prefs()
  32.    {
  33.    int i;
  34.    
  35.    for (i = 0; i < NUMBER_PREFS; i++)
  36.       preferences[i].type = BASE_PREFS + i;
  37.    }
  38.  
  39. VALUE get_pref(index)
  40. int index;
  41.    {
  42.    INIT_ONCE;
  43.  
  44.    return preferences[index-BASE_PREFS].data;
  45.    }
  46.  
  47. void set_pref(index, value)
  48. int index;
  49. VALUE value;
  50.    {
  51.    preferences[index-BASE_PREFS].data = value;
  52.    }
  53.  
  54. void set_pref_scalar(index, value)
  55. int index;
  56. int value;
  57.    {
  58.    VALUE temp;
  59.    
  60.    temp.scalar = value;
  61.    set_pref(index, temp);
  62.    }
  63.  
  64. int get_pref_scalar(index)
  65.    {
  66.    return get_pref(index).scalar;
  67.    }
  68.  
  69. struct tag *get_prefs()
  70.    {
  71.    INIT_ONCE;
  72.  
  73.    return preferences;
  74.    }
  75.